package com.beta.dto.home;

import com.beta.dto.product.ProductItemDto;
import com.beta.em.home.HomeBannerType;
import com.beta.support.ResourceImagePathBuilder;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

/**
 * Created by vector on 2017/2/15.
 */
@Getter
@Setter
public class HomeBannersDto implements Serializable {

    private Integer id;

    private String picUrl;

    private String newsUrl;

    private String bannerType;

    private Integer position;

    private Integer productId;

    private Integer productItemId;

    private String productName;

    private String cityCode;

    private String cityName;

    private Integer userId;

    private String userName;

    private Boolean available;

    private ProductItemDto productItem;

    public String getPicUrl() {
        return ResourceImagePathBuilder.homeBannerPicPath(id, picUrl);
    }

    public String getBannerTypeText() {
        return HomeBannerType.getCnValue(bannerType);
    }

    public Integer getDealerId() {
        return this.userId;
    }

    public String getDealerName() {
        return this.userName;
    }

}
